package com.xhwl.centiotdata.handler.pedestrian.impl;

import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONObject;
import com.xhwl.centiotdata.handler.pedestrian.PedestrianIntegrationFactory;
import com.xhwl.centiotdata.handler.pedestrian.PedestrianIntegrationHandler;
import com.xhwl.centiotdata.pojo.constant.DaHuaConstant;
import com.xhwl.centiotdata.pojo.constant.DaHuaIccConstant;
import com.xhwl.centiotdata.pojo.dto.dahua.DepartmentDaHuaIcc;
import com.xhwl.centiotdata.pojo.dto.dahua.PedestrianRecordDaHuaDTO;
import com.xhwl.centiotdata.pojo.dto.dahua.UserDaHuaIccDTO;
import com.xhwl.centiotdata.pojo.dto.dahua.UserDaHuaIccPersonBiosignatures;
import com.xhwl.centiotdata.pojo.dto.pedestrian.PedestrianIntegrationConfigDTO;
import com.xhwl.centiotdata.service.IOrgInfoService;
import com.xhwl.centiotdata.service.cent.*;
import com.xhwl.centiotdata.suppliersystem.dahua.GeneralDaHuaHandler;
import com.xhwl.centiotdata.suppliersystem.dahuaIcc.PedestrianDaHuaIccHandler;
import com.xhwl.centiotdata.utils.AccountUtil;
import com.xhwl.common.dto.auth.PedestrianAuthDTO;
import com.xhwl.common.dto.cent.device.DeviceDTO;
import com.xhwl.common.dto.cent.pedes.OpenDoorRecordDTO;
import com.xhwl.common.enums.*;
import com.xhwl.common.enums.pedestrian.DoorActionEnum;
import com.xhwl.common.exception.BusinessException;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.auth.AuthAccountMapping;
import com.xhwl.common.pojo.cent.auth.CardInfo;
import com.xhwl.common.pojo.cent.device.DeviceProjSupplierCategory;
import com.xhwl.common.pojo.cent.iot.OrgInfo;
import com.xhwl.common.pojo.cent.sdata.Account;
import com.xhwl.common.pojo.cent.sdata.Project;
import com.xhwl.common.pojo.cent.sdata.personnel.StaffDTO;
import com.xhwl.common.query.cent.device.ProductAccessQuery;
import com.xhwl.common.query.cent.sdata.AccountQuery;
import com.xhwl.common.vo.cent.auth.CardOfUserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @Author： wangyiling
 * @Description：
 * @Date 2022/08/11/ 09:44
 */
@Service
@Slf4j
public class PedestrianIntegrationDaHuaIccHandler extends PedestrianIntegrationHandler {

    @Autowired
    private PedestrianDaHuaIccHandler pedestrianDaHuaIccHandler;
    @Autowired
    private IPedestrianCentService pedestrianCentService;
    @Autowired
    private IAccountCentService accountCentService;
    @Autowired
    private IDeviceCentService deviceCentService;
    @Autowired
    private IAuthAccountCentService authAccountCentService;
    @Resource
    private IOrgInfoService iOrgInfoService;
    @Resource
    private IProjectCentService projectCentService;
    @Autowired
    private AccountUtil accountUtil;

    @Override
    public void afterPropertiesSet() throws Exception {
        PedestrianIntegrationFactory.register(ProductEnum.DAHUA_ICC.getId(), this);
    }

    @Override
    public void pullRecord(PedestrianIntegrationConfigDTO configDTO, Integer intervalDays, Date date) {
        // 拉取数据
        List<PedestrianRecordDaHuaDTO> recordDaHuaDTOList = pedestrianDaHuaIccHandler.pullRecord(intervalDays, configDTO);
        if (CollectionUtils.isEmpty(recordDaHuaDTOList)) {
            return;
        }
        // 转换数据
        List<OpenDoorRecordDTO> openDoorRecordDTOList = this.handleRecord(configDTO, recordDaHuaDTOList);
        // 存储业务中台

        pedestrianCentService.saveBatch(openDoorRecordDTOList);
    }

    @Override
    public void pullFaceRecord(PedestrianIntegrationConfigDTO configDTO, Integer intervalDays, Date date) {
        // 拉取数据
        List<PedestrianRecordDaHuaDTO> recordDaHuaDTOList = pedestrianDaHuaIccHandler.pullFaceRecord(intervalDays, configDTO);
        log.info("开始转存" + recordDaHuaDTOList);
        if (CollectionUtils.isEmpty(recordDaHuaDTOList)) {
            return;
        }
        // 转换数据
        List<OpenDoorRecordDTO> openDoorRecordDTOList = this.handleFaceRecord(configDTO, recordDaHuaDTOList);
        log.info("开始转存" + openDoorRecordDTOList);
        // 存储业务中台
        pedestrianCentService.saveFaceBatch(openDoorRecordDTOList);
    }

    @Override
    public ResultJson openDoor(PedestrianIntegrationConfigDTO configDTO, DeviceDTO deviceDTO, DoorActionEnum doorAction) {
        return pedestrianDaHuaIccHandler.openDoor(configDTO, deviceDTO, doorAction);
    }

    @Override
    public ResultJson createAuth(PedestrianIntegrationConfigDTO configDTO, PedestrianAuthDTO pedestrianAuthDTO) {
        //增加组织id
        handleOrgIds(pedestrianAuthDTO);
        this.createUser(configDTO, pedestrianAuthDTO);
        if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            try {
                pedestrianDaHuaIccHandler.addCardAuth(configDTO, pedestrianAuthDTO);
                onSavingAuthCards(authAccountCentService, configDTO, pedestrianAuthDTO);
            } catch (Exception e) {
                // 保存转换卡号数据失败
            }
        }
        pedestrianDaHuaIccHandler.addAuth(configDTO, pedestrianAuthDTO);
        return ResultJson.success();
    }

    /**
     * 增加组织id
     *
     * @param pedestrianAuthDTO
     */
    public void handleOrgIds(PedestrianAuthDTO pedestrianAuthDTO) {
        Project project = projectCentService.findById(pedestrianAuthDTO.getProjectId());
        StaffDTO staffDTO = accountUtil.getStaffOne(project.getEnterpriseId(), pedestrianAuthDTO.getAccountId());
        pedestrianAuthDTO.setOrgIds(staffDTO == null ? null : staffDTO.getOrgIds());
    }

    public ResultJson addUser(PedestrianIntegrationConfigDTO configDTO, PedestrianAuthDTO pedestrianAuthDTO) {

        this.createUser(configDTO, pedestrianAuthDTO);
        if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            try {
                pedestrianDaHuaIccHandler.addCardAuth(configDTO, pedestrianAuthDTO);
            } catch (Exception e) {
                // 保存转换卡号数据失败
            }
        }
        return ResultJson.success();
    }

    @Override
    public ResultJson updateAuth(PedestrianIntegrationConfigDTO configDTO, PedestrianAuthDTO pedestrianAuthDTO) {
        //更新之前判断用户是否存在 如果不存在需要创建
        log.error("----更新授权----------" + pedestrianAuthDTO);
        //增加组织id
        handleOrgIds(pedestrianAuthDTO);

        this.createUser(configDTO, pedestrianAuthDTO);
        if (CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            CardOfUserVO cardOfUserVO = new CardOfUserVO();
            cardOfUserVO.setSize(20);
            cardOfUserVO.setCurrent(1);
            cardOfUserVO.setUserId(pedestrianAuthDTO.getSourceId());
            cardOfUserVO.setProjectId(pedestrianAuthDTO.getProjectId());
            List<CardInfo> infos = authAccountCentService.getUserCardDetailByUserid(cardOfUserVO).getRecords();
            log.error("查询到的卡号信息：" + infos);
            if (!CollectionUtils.isEmpty(infos)) {
                List<String> cardNumberList = infos.stream().map(CardInfo::getNumber).collect(Collectors.toList());
                Map<Integer, Map<String, String>> carNumberMap  = pedestrianCentService.cardTransition(pedestrianAuthDTO.getProjectId(), cardNumberList);
                Map<String, String> carMap = carNumberMap.get(configDTO.getProductId());
                if (!CollectionUtils.isEmpty(carMap)) {
                    pedestrianAuthDTO.setCardNumberList(new ArrayList<>(carMap.values()));
                }
                log.error("转换后的卡号信息：" + pedestrianAuthDTO.getCardNumberList());
            }
        }

        if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            try {
                pedestrianDaHuaIccHandler.addCardAuth(configDTO, pedestrianAuthDTO);
                onSavingAuthCards(authAccountCentService, configDTO, pedestrianAuthDTO);
            } catch (Exception e) {
                // 保存转换卡号数据失败
            }
        }
        // 先删除
        if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            pedestrianDaHuaIccHandler.deleteAuth(configDTO, pedestrianAuthDTO.getCardNumberList());
        }
        if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList())) {
            if (!Objects.isNull(pedestrianAuthDTO.getValidStartTime())) {
                pedestrianDaHuaIccHandler.updateCardInfo(configDTO, pedestrianAuthDTO);
            }
            pedestrianDaHuaIccHandler.addAuth(configDTO, pedestrianAuthDTO);
        }
        return ResultJson.success();
    }

    @Override
    public ResultJson deleteAuth(PedestrianIntegrationConfigDTO configDTO, PedestrianAuthDTO pedestrianAuthDTO) {
        log.error("大华ICC人行权限数据：" + pedestrianAuthDTO.toString());
        if (CollectionUtils.isEmpty(pedestrianAuthDTO.getCardNumberList()) && CollectionUtils.isEmpty(pedestrianAuthDTO.getDeletedCardNumberList())) {
            CardOfUserVO cardOfUserVO = new CardOfUserVO();
            cardOfUserVO.setSize(20);
            cardOfUserVO.setCurrent(1);
            cardOfUserVO.setUserId(pedestrianAuthDTO.getSourceId());
            cardOfUserVO.setProjectId(pedestrianAuthDTO.getProjectId());
            List<CardInfo> infos = authAccountCentService.getUserCardDetailByUserid(cardOfUserVO).getRecords();
            log.error("查询到的卡号信息：" + infos);
            if (!CollectionUtils.isEmpty(infos)) {
                List<String> cardNumberList = infos.stream().map(CardInfo::getNumber).collect(Collectors.toList());
                Map<Integer, Map<String, String>> carNumberMap  = pedestrianCentService.cardTransition(pedestrianAuthDTO.getProjectId(), cardNumberList);
                Map<String, String> carMap = carNumberMap.get(configDTO.getProductId());
                if (!CollectionUtils.isEmpty(carMap)) {
                    pedestrianAuthDTO.setCardNumberList(new ArrayList<>(carMap.values()));
                }
                log.error("转换后的卡号信息：" + pedestrianAuthDTO.getCardNumberList());
            }
        }
        List<String> list = Optional.ofNullable(pedestrianAuthDTO.getCardNumberList()).orElse(new LinkedList<>());
        if (pedestrianAuthDTO.getCardNumber() != null) {
            list.add(pedestrianAuthDTO.getCardNumber());
        }
        // 只删卡的权限
        if (Objects.equals(pedestrianAuthDTO.getCardStatus(), 1)) {
            pedestrianDaHuaIccHandler.deleteAuth(configDTO, list);
            pedestrianDaHuaIccHandler.deleteCardAuth(configDTO, list);
        } else if (list.size() > 0) {  //删除卡权限
            pedestrianDaHuaIccHandler.deleteAuth(configDTO, list);
            pedestrianDaHuaIccHandler.deleteCardAuth(configDTO, list);
            pedestrianDaHuaIccHandler.deleteUser(configDTO, pedestrianAuthDTO);

        } else if (!CollectionUtils.isEmpty(pedestrianAuthDTO.getDeletedCardNumberList())) {
            pedestrianDaHuaIccHandler.deleteAuth(configDTO, pedestrianAuthDTO.getDeletedCardNumberList());
            pedestrianDaHuaIccHandler.deleteCardAuth(configDTO, pedestrianAuthDTO.getDeletedCardNumberList());
            pedestrianDaHuaIccHandler.deleteUser(configDTO, pedestrianAuthDTO);
        }else if (Objects.equals(list.size(),0)){
            pedestrianDaHuaIccHandler.deleteUser(configDTO, pedestrianAuthDTO);
        }
        return ResultJson.success();
    }

    private List<OpenDoorRecordDTO> handleRecord(PedestrianIntegrationConfigDTO configDTO, List<PedestrianRecordDaHuaDTO> recordDaHuaDTOList) {
        return recordDaHuaDTOList.stream()
                .filter(recordDaHuaDTO -> (recordDaHuaDTO.getCardType() != null && !DaHuaConstant.DOOR_EVENT_LIST.contains(recordDaHuaDTO.getOpenType())))
                .map(recordDaHuaDTO -> {
                    return OpenDoorRecordDTO.builder()
                            .projectId(configDTO.getProjectId())
                            .openUserId(this.handleOpenUserId(recordDaHuaDTO))
                            .openDeviceId(recordDaHuaDTO.getChannelCode())
                            .sourceType(this.handleRecordSourceType(recordDaHuaDTO))
                            .arrivalTime(recordDaHuaDTO.getSwingTime())
                            .pictureUrl(recordDaHuaDTO.getRecordImage())
                            .state(recordDaHuaDTO.getOpenResult().shortValue())
                            .code(String.valueOf(recordDaHuaDTO.getId()))
                            .type(this.handleRecordType(recordDaHuaDTO.getOpenType()))
                            .direction(this.handleDirection(recordDaHuaDTO.getEnterOrExit()))
                            .approach(AccessApproachEnum.OFF_LINE.getId())
                            .userName(recordDaHuaDTO.getPersonName()).build();
                }).collect(Collectors.toList());
    }

    //   人脸对比数据处理
    private List<OpenDoorRecordDTO> handleFaceRecord(PedestrianIntegrationConfigDTO configDTO, List<PedestrianRecordDaHuaDTO> recordDaHuaDTOList) {
        return recordDaHuaDTOList.stream()
                .map(recordDaHuaDTO -> {
                    return OpenDoorRecordDTO.builder()
                            .projectId(configDTO.getProjectId())
                            .openUserId(String.valueOf(recordDaHuaDTO.getPersonId()))
                            .openDeviceId(recordDaHuaDTO.getChannelid())
                            .sourceType(SourceTypeEnum.USER.type)
                            .arrivalTime(handleRectime(recordDaHuaDTO.getRectime()))
                            .pictureUrl(recordDaHuaDTO.getFacepath())
                            .state((short) 1)
                            .type(AccessTypeEnum.FACE.getId())
                            .sex(Integer.valueOf(handleSexStr(recordDaHuaDTO.getSexStr())))
                            .similarity(recordDaHuaDTO.getSimilarity())
                            .groupId(recordDaHuaDTO.getGroupid())
                            .groupName(recordDaHuaDTO.getGroupname())
                            .approach(AccessApproachEnum.OFF_LINE.getId())
                            .userName(recordDaHuaDTO.getName()).build();
                }).collect(Collectors.toList());
    }

    private String handleRectime(Long time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        String sd = sdf.format(new Date(time)); //把时间戳转为日期
        return sd;
    }

    private String handleOpenUserId(PedestrianRecordDaHuaDTO recordDaHuaDTO) {
        // 62 人脸非法刷门 定义为陌生人，针对人数统计默认人员code
        if (62 == recordDaHuaDTO.getOpenType().intValue()) {
            return UUID.randomUUID().toString();
        }
        return recordDaHuaDTO.getPersonId() == null ? null : recordDaHuaDTO.getPersonId().toString();
    }


    private Short handleRecordType(Integer openType) {
        switch (openType) {
            case 42:
            case 43:
            case 44:
                return AccessTypeEnum.PASS_WORD.getId();
            case 45:
            case 46:
            case 47:
                return AccessTypeEnum.FINGERPRINT.getId();
            case 48:
                return AccessTypeEnum.REMOTE.getId();
            case 49:
                return AccessTypeEnum.BUTTON.getId();
            case 51:
            case 52:
                return AccessTypeEnum.IC_CARD.getId();
            case 60:
            case 61:
            case 62:
                return AccessTypeEnum.FACE.getId();
            case 1434:
                return AccessTypeEnum.QR_CODE.getId();
            default:
                return AccessTypeEnum.OTHER.getId();
        }
    }

    private Integer handleRecordSourceType(PedestrianRecordDaHuaDTO recordDaHuaDTO) {
        // 62 人脸非法刷门 定义为陌生人
        if (62 == recordDaHuaDTO.getOpenType().intValue()) {
            return SourceTypeEnum.STRANGER.type;
        }
        switch (recordDaHuaDTO.getCardType()) {
            case 0:
            case 1:
            case 3:
            case 6:
            case 11:
                return SourceTypeEnum.USER.type;
            case 2:
                return SourceTypeEnum.VISITOR_USER.type;
            default:
                return SourceTypeEnum.STRANGER.type;
        }
    }

    private Short handleDirection(Integer enterOrExit) {
        switch (enterOrExit) {
            case 1:
                return DirectionEnum.IN.getId();
            case 2:
                return DirectionEnum.OUT.getId();
            default:
                return DirectionEnum.UNKNOWN.getId();
        }
    }

    private Short handleSexStr(String sexStr) {
        switch (sexStr) {
            case "男":
                return 1;
            case "女":
                return 2;
            default:
                return 0;
        }
    }

    private AuthAccountMapping createUser(PedestrianIntegrationConfigDTO configDTO, PedestrianAuthDTO pedestrianAuthDTO) {
        Integer accountId = pedestrianAuthDTO.getSourceId();
        AccountQuery accountQuery = new AccountQuery();
        accountQuery.setId(accountId);
        Account account = accountCentService.getAccount(null, accountQuery);
        if (account == null) {
            throw new BusinessException("不存在该人员！");
        }
        if (!StringUtils.isEmpty(pedestrianAuthDTO.getUserOpenId())) {
            AuthAccountMapping authAccountMapping = pedestrianDaHuaIccHandler.queryUser(pedestrianAuthDTO, configDTO);//查询人员详情
            if (authAccountMapping != null) {
                return authAccountMapping;
            }
        } else {
            String openId = pedestrianDaHuaIccHandler.getUserId(configDTO);
            pedestrianAuthDTO.setUserOpenId(openId);
            pedestrianAuthDTO.setUserOpenIds(Collections.singletonList(openId));
        }

        String paperNumber = account.getIdCard();
        Integer paperType = DaHuaIccConstant.DEFAULT_PAPER_TYPE;
        Date birthday = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        if (!StringUtils.isEmpty(paperNumber) && IdcardUtil.isValidCard(paperNumber)) {
            try {
                // 注意格式需要与上面一致，不然会出现异常
                birthday = sdf.parse(IdcardUtil.getBirth(paperNumber));
            } catch (java.text.ParseException e) {
                e.printStackTrace();
            }
        } else {//如果没有身份证号码 证件类型选其他 用手机号码 生日选一个默认值
            try {
                // 注意格式需要与上面一致，不然会出现异常
                birthday = sdf.parse(IdcardUtil.getBirth("110101199007012417"));
            } catch (java.text.ParseException e) {
                e.printStackTrace();
            }
            paperNumber = account.getPhone();
            paperType = -1;
        }

        UserDaHuaIccDTO userDaHuaDTO = UserDaHuaIccDTO.builder().birthday(birthday)
                .id(pedestrianAuthDTO.getUserOpenId())
                .code(GeneralDaHuaHandler.generateOpenCode(account.getId(), configDTO.getProjectId()))
                .name(account.getName())
                .paperNumber(paperNumber)
                .paperType(paperType)
                .paperAddress(DaHuaIccConstant.DEFAULT_ADDRESS)
                .phone(account.getPhone())
                .service(DaHuaIccConstant.DEFAULT_SERVICE)
                .sex(account.getSex() == null ? 0 : account.getSex() == 0 ? 2 : account.getSex().intValue()).build();
        handleUserDepartment(userDaHuaDTO, pedestrianAuthDTO.getOrgIds(), configDTO);
        String path = pedestrianDaHuaIccHandler.getImageUrl(pedestrianAuthDTO, configDTO);
        if (!StringUtils.isEmpty(path)) {
            UserDaHuaIccPersonBiosignatures userDaHuaIccPersonBiosignatures = new UserDaHuaIccPersonBiosignatures();
            userDaHuaIccPersonBiosignatures.setType(DaHuaIccConstant.DAHUA_FACE_TYPE);
            userDaHuaIccPersonBiosignatures.setIndex(1);
            userDaHuaIccPersonBiosignatures.setPath(path);
            userDaHuaDTO.setPersonBiosignatures(Collections.singletonList(userDaHuaIccPersonBiosignatures));
        }
        AuthAccountMapping authAccountMapping = pedestrianDaHuaIccHandler.createUser(configDTO, userDaHuaDTO);
        authAccountCentService.save(configDTO.getProjectId(), pedestrianAuthDTO.getSourceId(), pedestrianAuthDTO.getUserOpenId(), null, configDTO.getProductId());
        return authAccountMapping;
    }

    /**
     * 处理部门字段 大华icc找不到对应组织时用集成配置中默认的部门
     */
    public void handleUserDepartment(UserDaHuaIccDTO userDaHuaDTO, List<Integer> orgIds, PedestrianIntegrationConfigDTO configDTO) {
        if (orgIds == null || orgIds.isEmpty()) {
            userDaHuaDTO.setDepartmentId(getDefaultDepartment(configDTO));
        } else if (orgIds.size() == 1) {
            OrgInfo orgInfo = iOrgInfoService.getOrgInfo(orgIds.get(0), configDTO.getProductId());
            userDaHuaDTO.setDepartmentId(orgInfo != null ? Integer.parseInt(orgInfo.getOrgIndexCode()) : getDefaultDepartment(configDTO));
        } else {
            List<DepartmentDaHuaIcc> departments = new ArrayList<>();
            for (Integer orgId : orgIds) {
                OrgInfo orgInfo = iOrgInfoService.getOrgInfo(orgId, configDTO.getProductId());
                if (orgInfo != null) {
                    departments.add(DepartmentDaHuaIcc.builder().departmentId(Integer.parseInt(orgInfo.getOrgIndexCode())).departmentType(2).build());
                }
            }
            if (!departments.isEmpty()) {
                departments.get(0).setDepartmentType(1);//设置一个主部门
                userDaHuaDTO.setDepartmentList(departments);
            } else {
                userDaHuaDTO.setDepartmentId(getDefaultDepartment(configDTO));
            }
        }
    }

    private Integer getDefaultDepartment(PedestrianIntegrationConfigDTO configDTO) {
        // 从集成配置中获取默认的部门id,这里的listProductAccess接口的入参不能唯一确定一个供应商的配置，需要重新过滤一遍
        List<DeviceProjSupplierCategory> allLDeviceConfigList = deviceCentService.listProductAccess(null, new ProductAccessQuery(configDTO.getProjectId(), CategoryEnum.DOOR.getId()));
        List<DeviceProjSupplierCategory> deviceConfigList = allLDeviceConfigList.stream().filter(item -> item.getProductId().equals(ProductEnum.DAHUA_ICC.getId())).collect(Collectors.toList());
        JSONObject properties = deviceConfigList.get(0).getProperties();
        return properties.getInteger("departmentId");
    }

    private static String getFour(String str) {
        if (StringUtils.isEmpty(str)) {
            return "0000";
        }
        int length = str.length();
        if (length == 4) {
            return str;
        }
        if (length < 4) {
            StringBuilder strBuilder = new StringBuilder(str);
            for (int i = 0; i < 4 - length; i++) {
                strBuilder.insert(0, "0");
            }
            return strBuilder.toString();
        }
        return str.substring(0, 4);
    }

    /**
     * 业主二维码
     *
     * @param configDTO
     * @return
     */
    @Override
    public ResultJson getInsideQrCode(PedestrianIntegrationConfigDTO configDTO, OpenDoorRecordDTO openDoorRecordDTO) {
        return pedestrianDaHuaIccHandler.getInsideQrCode(configDTO, openDoorRecordDTO);
    }

}
